package cn.tedu.apps_system.mapper;

import cn.tedu.apps_system.pojo.dto.OrderReviseDto;
import cn.tedu.apps_system.pojo.entity.Order;
import org.apache.ibatis.annotations.*;
import cn.tedu.apps_system.pojo.entity.OrderItem;
import cn.tedu.apps_system.pojo.vo.OrderVO;

import java.util.List;

public interface OrderMapper {
    int create(Order order);

    int addItems(List<OrderItem> items);

    int reviseOrder(Order order);

    int deleteOrder(OrderReviseDto orderReviseDto);

    OrderVO selectOrder(OrderReviseDto orderReviseDto);

    OrderVO selectAllOrder(OrderReviseDto orderReviseDto);

    //商家添加
    List<Order> selectByMerchantId(Long merchantId);

    List<Order> selectByMerchantIdAndStatus(@Param("merchantId") Long merchantId,
                                            @Param("status") Integer status);

    Order selectById(Long id);

    int deleteById(Long id);

    int updateStatus(@Param("id") Long id, @Param("status") Integer status);
}
